var t = getApp();

Page({
    data: {
        page: 1
    },
    onLoad: function(t) {
        this.getdata();
    },
    tapGO: function(t) {
        console.log(t);
        var a = t.currentTarget.dataset.item.auctioneer_id;
        wx.navigateTo({
            url: "/packageD/auction/auctioneer-shop/auctioneer_shop/auctioneer_shop?id=" + a
        });
    },
    toCollect: function(a) {
        var e = {
            art: "collectionShop",
            auctioneer_id: a.currentTarget.dataset.id
        }, o = this, n = t.getNetAddresss("plugin.auction.api.index.getAuctionData");
        t._getNetWork({
            url: n,
            data: e,
            success: function(t) {
                var a = t.data;
                1 == a.result ? o.getdata() : wx.showToast({
                    title: a.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (this.data.current_page >= this.data.last_page) wx.showToast({
            title: "暂无更多",
            duration: 1e3,
            icon: "none"
        }); else {
            var t = this.data.page + 1;
            this.setData({
                page: t
            }), this.getNextdata();
        }
    },
    onShareAppMessage: function() {},
    getdata: function() {
        var a = this, e = {
            art: "collectionList",
            page: a.data.page
        }, o = t.getNetAddresss("plugin.auction.api.index.getAuctionData");
        t._postNetWork({
            url: o,
            data: e,
            success: function(t) {
                var e = t.data;
                1 == e.result ? (console.log(e), a.setData({
                    datas: e.data.collectionList.data,
                    current_page: e.data.collectionList.current_page,
                    last_page: e.data.collectionList.last_page
                })) : wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    getNextdata: function() {
        var a = this, e = {
            art: "collectionList",
            page: a.data.page
        }, o = t.getNetAddresss("plugin.auction.api.index.getAuctionData");
        t._postNetWork({
            url: o,
            data: e,
            success: function(t) {
                var e = t.data;
                1 == e.result ? (console.log(e), a.setData({
                    datas: a.data.datas.concat(e.data.collectionList.data),
                    current_page: e.data.collectionList.current_page,
                    last_page: e.data.collectionList.last_page
                })) : wx.showToast({
                    title: e.msg,
                    icon: "none",
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    }
});